#include <stdio.h>
int main() {
    int s, v;
    scanf("%d %d",&s,&v);
    int travel_time = s / v;
    if (s%v!= 0) 
	{
        travel_time += 1;
    }
    int total_time = travel_time + 10;
    int departure_minutes = 480 - total_time;
    if (departure_minutes < 0) 
	{
        departure_minutes += 1440;
    }
    int hours = departure_minutes / 60;
    int minutes = departure_minutes % 60;
    printf("%02d:%02d\n", hours, minutes);
    return 0;
}
